home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / bbs / mxu_v152.zip / MAKEDROP.PAS < prev    next >
Pascal/Delphi Source File  |  1997-03-08  |  8KB  |  211 lines

  1. {
  2. ───────────────────────────────────────────────────────────────────────────────
  3.   ▀▀▀   ▀▀▀   ▀▀▀▀▀   ▀▀   ▀▀
  4.   ▀▀▀▀ ▀▀▀▀  ▀▀   ▀▀   ▀▀ ▀▀
  5.   ▀▀ ▀▀▀ ▀▀  ▀▀▀▀▀▀▀    ▀▀▀    ╔══ ╦═╗ ╔═╗ ╦═╗ ╦ ╦ ╦ ╔═╗ ╔═╗
  6.   ▀▀  ▀  ▀▀  ▀▀   ▀▀   ▀▀ ▀▀   ║ ╦ ╠╦╝ ╠═╣ ╠═╝ ╠═╣ ║ ║   ╚═╗
  7.   ▀▀     ▀▀  ▀▀   ▀▀  ▀▀   ▀▀  ╚═╝ ╩╚═ ╩ ╩ ╩   ╩ ╩ ╩ ╚═╝ ╚═╝
  8. ───────────────────────────────────────────────────────────────────────────────
  9.   The Universal Multimedia Interface For BBS Software
  10.   Copyright 1995-1997 * Larry L. Athey * BBS Utiliteez Software
  11. ───────────────────────────────────────────────────────────────────────────────
  12.  
  13.   Information Regarding MAX Graphics:
  14.   ───────────────────────────────────
  15.   Notice is hereby given that the MAXscript/MAXcontrol/MAXcolor language,
  16.   and MAXterm are products of BBS Utiliteez Software and are protected by
  17.   US copyrights listed with the US Library Of Congress (1996)....
  18.  
  19.   No changes, additions, subtractions, or other modifications shall be made
  20.   to MAXscript/MAXcontrol/MAXcolor language or the MAX Graphics development
  21.   kit without express written permission from Larry L. Athey, BBS Utiliteez
  22.   Software, Alliance, Nebraska, USA....
  23.  
  24.   The MAXscript/MAXcontrol/MAXcolor language may be used in any BBS or Door
  25.   software 100% royalty free. You are also allowed to implement full local
  26.   graphics viewing in any BBS or Door software 100% royalty free. However,
  27.   any program that uses the MAXscript/MAXcontrol/MAXcolor language *MUST*
  28.   bear the MAX Graphics/BBS Utiliteez Software copyright notice....
  29.  
  30.  
  31.   Example: MAX Graphics and the MAXscript/MAXcontrol/MAXcolor language is
  32.            Copyright 1995-1997 * Larry L. Athey * BBS Utiliteez Software
  33.  
  34. ───────────────────────────────────────────────────────────────────────────────    }
  35. {$A+,B-,D+,E+,F+,G+,I-,L+,N-,O-,P-,Q-,R-,S-,T-,V+,X+}
  36. PROGRAM MAKEDROP;
  37.  
  38. USES CRT, TDK_VARS, DOORKIT2, DOORKIT3;
  39.  
  40. VAR
  41.   WorkDir : STRING;
  42.  
  43. PROCEDURE CommandLineHelp;
  44. BEGIN
  45.   ShowProgramAd;
  46.   Writeln('');
  47.   IceText('Command Syntax:',TRUE);
  48.   LineBar(1,0,15);
  49.   IceText('MAKEDROP.EXE /N[Node #] /S[Baud Rate] /M[Minutes Left] /D=[DropFile Path]',TRUE);
  50.   Writeln('');
  51.   IceText('Or:',TRUE);
  52.   Writeln('');
  53.   IceText('MAKEDROP.EXE /N1 /S28800 /M30 /D=C:\BBS\NODE1\',TRUE);
  54.   GotoXY(1,24);
  55.   AnyKey;
  56.   HALT;
  57. END;
  58.  
  59. PROCEDURE WriteDorInfo;
  60. VAR
  61.   _DorInfo : TEXT;
  62.    Loop    : BYTE;
  63.    DI      : ARRAY[1..12] OF STRING[40];
  64. BEGIN
  65.   WRITELN('Creating '+DropFilePath+'DORINFO1.DEF');
  66.   ASSIGN(_DorInfo,DropFilePath+'DORINFO1.DEF');
  67.   DI[1] := Ctl.BBSname;                       {BBS Name}
  68.   DI[2] := Ctl.SFirst;                        {Sysop First}
  69.   DI[3] := Ctl.SLast;                         {Sysop Last}
  70.   DI[4] := 'COM' + IntToStr(DoorSys.Comport); {Comm Port}
  71.   DI[5] := IntToStr(DoorSys.BaudRate) + ' BAUD,' +
  72.            Ctl.Parity + ',' +
  73.            IntToStr(Ctl.WordSize) + ',' +
  74.            IntToStr(Ctl.StopBits);            {Baud And Parity}
  75.   DI[6] := '0';                               {Always Zero}
  76.   DI[7] := IntToStr(DoorSys.BaudRate)+'Baud'; {User First}
  77.   DI[8] := 'Caller';                          {User Last}
  78.   DI[9] := Ctl.BBSname;                       {User Location}
  79.   DI[10] := '1';                              {Terminal Emulation}
  80.   DI[11] := '0';                              {Security}
  81.   DI[12] := IntToStr(DoorSys.MinutesLeft);    {Minutes Remaining}
  82.   REWRITE(_Dorinfo);
  83.   FOR Loop := 1 TO 12 DO WRITELN(_Dorinfo,DI[Loop]);
  84.   CLOSE(_Dorinfo);
  85. END;
  86.  
  87. PROCEDURE ReadCTL;
  88. VAR
  89.   NodeStr : STRING[3];
  90.   CtlFile : FILE OF ControlFile;
  91. BEGIN
  92.   STR(DoorSys.Node,NodeStr);
  93.   IF NOT FExist('NODE' + NodeStr + '.CTL') THEN BEGIN
  94.     ClrScr;
  95.     OutTxtL(15,4,'!!! FATAL ERROR !!!');
  96.     Writeln('');
  97.     OutTxtL(12,0,'NODE' + NodeStr + '.CTL Not Found!');
  98.     Writeln('');
  99.     OutTxtL(4,0,'Please Run The MAKECTL.EXE Program');
  100.     OutTxtL(4,0,'To Create A Control File For Node #' + NodeStr + '!');
  101.     AlertTones;
  102.     Wait(2);
  103.     ErrorLog('FATAL ERROR - NODE' + NodeStr + '.CTL NOT FOUND!',6,TRUE);
  104.   END;
  105.   ASSIGN(CtlFile,'NODE' + NodeStr + '.CTL');
  106.   RESET(CtlFile);
  107.   READ(CtlFile,Ctl);
  108.   CLOSE(CtlFile);
  109.   IF Ctl.HomePath = '\' THEN BEGIN
  110.     ClrScr;
  111.     OutTxtL(15,4,'!!! FATAL ERROR !!!');
  112.     Writeln('');
  113.     OutTxtL(12,0,'No BBS Home Directory Defined In NODE' + NodeStr + '.CTL!');
  114.     Writeln('');
  115.     OutTxtL(4,0,'Please Run The MAKECTL.EXE Program');
  116.     OutTxtL(4,0,'To Correct This Error.............');
  117.     AlertTones;
  118.     Wait(2);
  119.     ErrorLog('FATAL ERROR - No BBS Home Directory Defined In NODE' + NodeStr + '.CTL!',6,TRUE);
  120.   END;
  121.   WITH DoorSys DO BEGIN
  122.     IF Ctl.UseFossil THEN WhichIO := FossilIO ELSE WhichIO := InternalIO;
  123.     Comport    := Ctl.Port;
  124.     WordSize   := Ctl.WordSize;
  125.     Parity     := Ctl.Parity;
  126.     StopBits   := Ctl.StopBits;
  127.     InBufSize  := Ctl.InBuffer;
  128.     OutBufSize := Ctl.OutBuffer;
  129.   END;
  130. END;
  131.  
  132. PROCEDURE DoCommandLine;
  133. VAR
  134.   TempParam : STRING;
  135.   Time,
  136.   NewBaud   : LONGINT;
  137.   NewNode,
  138.   Code      : INTEGER;
  139.   Loop      : BYTE;
  140. BEGIN
  141.   NewNode := - 1;
  142.   NewBaud := 0;
  143.   Local   := FALSE;
  144.   IF PARAMCOUNT = 0 THEN CommandLineHelp;
  145.   FOR Loop := 1 TO PARAMCOUNT DO BEGIN
  146.     TempParam := AllCaps(PARAMSTR(Loop));
  147.     IF TempParam[1] = '/' THEN BEGIN
  148.       CASE TempParam[2] OF
  149.         'D' : BEGIN
  150.                 DropFilePath := COPY(TempParam,4,255);
  151.                 DropFilePath := FixPath(DropFilePath);
  152.               END;
  153.         'M' : BEGIN
  154.                 VAL(COPY(TempParam,3,255),Time,Code);
  155.                 IF Code <> 0 THEN BEGIN
  156.                   WRITELN('Error In Forced Time Limit: ' + TempParam);
  157.                   AlertTones;
  158.                   ErrorLog('Error In Forced Time Limit: ' + TempParam,ErrLevel,TRUE);
  159.                 END;
  160.               END;
  161.         'N' : BEGIN
  162.                 VAL(COPY(TempParam,3,255),NewNode,Code);
  163.                 IF Code <> 0 THEN BEGIN
  164.                   WRITELN('Error In Forced Node Number: ' + TempParam);
  165.                   AlertTones;
  166.                   ErrorLog('Error In Forced Node Number: ' + TempParam,ErrLevel,TRUE);
  167.                 END;
  168.               END;
  169.         'S' : BEGIN
  170.                 VAL(COPY(TempParam,3,255),NewBaud,Code);
  171.                 IF Code <> 0 THEN BEGIN
  172.                   WRITELN('Error In Forced Baud Rate: ' + TempParam);
  173.                   AlertTones;
  174.                   ErrorLog('Error In Forced Baud Rate: ' + TempParam,ErrLevel,TRUE);
  175.                 END;
  176.               END;
  177.         '?' : CommandLineHelp;
  178.         'H' : CommandLineHelp;
  179.         ELSE BEGIN
  180.           CommandLineHelp;
  181.         END;
  182.       END;
  183.     END ELSE BEGIN
  184.       CommandLineHelp;
  185.     END;
  186.   END;
  187.   IF NewNode <> - 1 THEN DoorSys.Node := NewNode;
  188.   IF Time <> 0 THEN DoorSys.MinutesLeft := Time;
  189.   IF NewBaud <> 0 THEN DoorSys.BaudRate := NewBaud;
  190.   ReadCTL;
  191. END;
  192.  
  193. {-----------------------------------------------------------------------------}
  194.  
  195. BEGIN
  196.   ClrScr;
  197.   ProgramName := 'MAKEDROP.EXE v1.10';
  198.   ProgramDesc := 'DORINFO1.DEF DropFile Creator';
  199.   GETDIR(0,WorkDir);
  200.   IF PARAMCOUNT < 4 THEN CommandLineHelp;
  201.   DoCommandLine;
  202.   WorkDir := WorkDir + IntToStr(DoorSys.Node);
  203.   MakeDir(WorkDir);
  204.   IF NOT DExist(DropFilePath) THEN BEGIN
  205.     WRITELN('Error In Drop File Path: ' + DropFilePath);
  206.     AlertTones;
  207.     ErrorLog('Error In Drop File Path: ' + DropFilePath,ErrLevel,TRUE);
  208.   END;
  209.   WriteDorInfo;
  210. END.
  211.